}
static void
-get_fast_child_requisition (GtkWidget *widget,
- GtkRequisition *requisition)
+get_fast_size (GtkWidget *widget,
+ GtkRequisition *minimum_size,
+ GtkRequisition *natural_size)
{
GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (widget, FALSE);
- *requisition = widget->requisition;
-
- if (aux_info)
+ if (minimum_size)
{
- if (aux_info->width > 0)
- requisition->width = aux_info->width;
- if (aux_info->height > 0)
- requisition->height = aux_info->height;
+ *minimum_size = widget->requisition;
+
+ if (aux_info)
+ {
+ if (aux_info->width > 0)
+ minimum_size->width = aux_info->width;
+ if (aux_info->height > 0)
+ minimum_size->height = aux_info->height;
+ }
}
-}
-
-static void
-get_fast_natural_size (GtkWidget *widget,
- GtkRequisition *requisition)
-{
- GtkWidgetAuxInfo *aux_info = _gtk_widget_get_aux_info (widget, FALSE);
- if (aux_info)
- *requisition = aux_info->natural_size;
- else
- *requisition = widget->requisition;
+ if (natural_size)
+ {
+ if (aux_info)
+ {
+ *natural_size = aux_info->natural_size;
+
+ /* Explicit size request sets the baseline for natural size
+ * as well as the minimum size
+ */
+ if (aux_info->width > natural_size->width)
+ natural_size->width = aux_info->width;
+ if (aux_info->height > natural_size->height)
+ natural_size->height = aux_info->height;
+ }
+ else
+ *natural_size = widget->requisition;
+ }
}
/**
*
* Retrieve the "child requisition" of the widget, taking account grouping
* of the widget's requisition with other widgets.
+ *
+ * Deprecated: 3.0: Use _gtk_size_group_compute_desired_size() instead
**/
void
_gtk_size_group_get_child_requisition (GtkWidget *widget,
/* Only do the full computation if we actually have size groups */
}
else
- get_fast_child_requisition (widget, requisition);
+ get_fast_size (widget, requisition, NULL);
}
}
{
do_size_request (widget);
- if (minimum_size)
- get_fast_child_requisition (widget, minimum_size);
- if (natural_size)
- get_fast_natural_size (widget, natural_size);
+ get_fast_size (widget, minimum_size, natural_size);
}
}